-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extends "spo user ensure" command with support for specifying more options. Closes #6181 #6426
base: main
Are you sure you want to change the base?
Conversation
Thank you @nanddeepn, we'll try to review it ASAP! |
@nanddeepn I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start, let's do a couple of changes before we proceed.
}); | ||
|
||
await command.action(logger, { options: { verbose: true, webUrl: validWebUrl, entraGroupName: validEntraSecurityGroupName } }); | ||
assert(loggerLogSpy.calledWith(ensuredSecurityGroupResponse)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check the request body instead of the output of the command.
@nanddeepn, did you find some time to look at my comments? |
I have started working on it. Facing some issues with merge conflicts, but will let you know when I update the PR. Thank you. |
Hi @milanholemans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a few tiny remarks, nothing to add.
}); | ||
|
||
await command.action(logger, { options: { verbose: true, webUrl: validWebUrl, loginName: validLoginName } }); | ||
assert(loggerLogSpy.calledWith(ensuredUserResponse)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check for the request body here as well.
sinon.stub(entraGroup, 'getGroupById').callsFake(async () => { | ||
return groupM365Response.value[0]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sinon.stub(entraGroup, 'getGroupById').callsFake(async () => { | |
return groupM365Response.value[0]; | |
}); | |
sinon.stub(entraGroup, 'getGroupById').resolves(groupM365Response.value[0]); |
sinon.stub(entraGroup, 'getGroupByDisplayName').callsFake(async () => { | ||
return groupSecurityResponse.value[0]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sinon.stub(entraGroup, 'getGroupByDisplayName').callsFake(async () => { | |
return groupSecurityResponse.value[0]; | |
}); | |
sinon.stub(entraGroup, 'getGroupByDisplayName').ensures(groupSecurityResponse.value[0]); |
sinon.stub(entraGroup, 'getGroupByDisplayName').callsFake(async () => { | ||
return groupM365Response.value[0]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use .resolves(...)
Extends
spo user ensure
command with support for specifyingloginName
,entraGroupId
, andentraGroupName
options. Closes #6181